package dd.prog2.exercises.set03;

//import java.text.DecimalFormat;

public abstract class Function {

	protected abstract double map(double x);

	public void print(double x, double x2, double step) {
//		DecimalFormat df = new DecimalFormat("0.00");;
		System.out.println("\t x\t f(x)");
		while (x <= x2) {
//			System.out.println("\t" + df.format(x) + "\t" + df.format(this.map(x)));
			System.out.printf("%.2f -> %.2f\n", x, map(x));
			x += step;

		}

	}

//	public double derivationCalc(double x, double dx) {
//		return (this.map(x + dx) - this.map(x - dx)) / (2 * dx);
//	}
}
